import React from "react";

import PageContent from '../../PageContent';

import {setStoreItem,getStoreItem} from '../../common';

import ProductUIImageListPanel from './ProductUIImageDataTablePanel';
/** 
 *产品UI图标管理
*/
export default class ProductUIImageManageApp extends React.Component {

	actionHandler = (actionEvent,panelInstance) => {

		return {
						        
			refresh  :  () => {
				panelInstance.loadData();
			},
									        
			addNew  :  () => {
				panelInstance.addNew();
			},
									        
			doDelete  :  () => {
				panelInstance.doDelete(actionEvent.params);
			},	
													
			doEdit  :  () => {
				panelInstance.doEdit(actionEvent.params);
			},
																						
			doSave  :  () => {
				panelInstance.doSave();
			},
												
		};
	}

	render() {
		return (
			<PageContent {...this.props} pageInstance={this} >
				<ProductUIImageListPanel 
					actionHandler={this.actionHandler} 
					ref={inst => this.uiImageListRef = inst}
					onSearchData={(values) => {setStoreItem('searchUIDomainFormData',values)}}
					initSearchValues={getStoreItem('searchUIDomainFormData')}
				/>
			</PageContent>
		);
	}
}